From: Matthias Clasen Date: Fri, 6 Jul 2012 01:11:22 +0000 (-0400) Subject: Implemented banner support for the login screen X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6370 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b4464929cbd6c8ceba1c93a5c88f1b6875053450;p=gnome-shell.git Implemented banner support for the login screen Based on a patch by Marius Rieder, https://bugzilla.gnome.org/review?bug=665346 --- diff --git a/data/theme/gdm.css b/data/theme/gdm.css index e8e4d2a9d..daaa57546 100644 --- a/data/theme/gdm.css +++ b/data/theme/gdm.css @@ -16,6 +16,14 @@ /* Login Dialog */ +.login-dialog-banner { + font-size: 10pt; + font-weight: bold; + text-align: center; + color: #666666; + padding-bottom: 1em; +} + .login-dialog-title { font-size: 14pt; font-weight: bold; diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index c00c21442..6ea415140 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -49,6 +49,8 @@ const _LOGO_ICON_NAME_SIZE = 48; const _LOGIN_SCREEN_SCHEMA = 'org.gnome.login-screen'; const _FINGERPRINT_AUTHENTICATION_KEY = 'enable-fingerprint-authentication'; +const _BANNER_MESSAGE_KEY = 'banner-message-enable'; +const _BANNER_MESSAGE_TEXT_KEY = 'banner-message-text'; const _LOGO_KEY = 'logo'; @@ -780,11 +782,20 @@ const LoginDialog = new Lang.Class({ this._startFingerprintConversationIfNeeded(); this._settings.connect('changed::' + _LOGO_KEY, Lang.bind(this, this._updateLogo)); + this._settings.connect('changed::' + _BANNER_MESSAGE_KEY, + Lang.bind(this, this._updateBanner)); + this._settings.connect('changed::' + _BANNER_MESSAGE_TEXT_KEY, + Lang.bind(this, this._updateBanner)); this._logoBox = new St.Bin({ style_class: 'login-dialog-logo-box' }); this.contentLayout.add(this._logoBox); this._updateLogo(); + this._bannerLabel = new St.Label({ style_class: 'login-dialog-banner', + text: '' }); + this.contentLayout.add(this._bannerLabel); + this._updateBanner(); + this._titleLabel = new St.Label({ style_class: 'login-dialog-title', text: C_("title", "Sign In") }); @@ -917,6 +928,18 @@ const LoginDialog = new Lang.Class({ }, + _updateBanner: function() { + let enabled = this._settings.get_boolean(_BANNER_MESSAGE_KEY); + let text = this._settings.get_string(_BANNER_MESSAGE_TEXT_KEY); + + if (enabled && text) { + this._bannerLabel.set_text(text); + this._fadeInBanner(); + } else { + this._fadeOutBanner(); + } + }, + _onReset: function(client, serviceName) { this._greeterClient.call_start_conversation(_PASSWORD_SERVICE_NAME); this._startFingerprintConversationIfNeeded(); @@ -1284,6 +1307,14 @@ const LoginDialog = new Lang.Class({ return _fadeOutActor(this._logoBox); }, + _fadeInBanner: function() { + return _fadeInActor(this._bannerLabel); + }, + + _fadeOutBanner: function() { + return _fadeOutActor(this._bannerLabel); + }, + _fadeInTitleLabel: function() { return _fadeInActor(this._titleLabel); },